#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2017/5/10 下午5:35
# @Author  : zhangzhen
# @Site    : 
# @File    : demo.py
# @Software: PyCharm
import numpy as np

m1 = np.ones(2)
m2 = np.ones(3)
print np.append(m1, m2)

a = [24,  33,  36,  25,  21,  25,  34]
b = [111,  83,  53,   78, 100,  40,  37]

print np.sum(a)
print np.sum(a)+np.sum(b)
print 1.0*np.sum(a)/(np.sum(a)+np.sum(b))

a = [29,  44,  26,  22,  29,  32,  32]
b = [96,  107,   44,   88,   67,   37,   47]

print np.sum(a)
print np.sum(a)+np.sum(b)
print 1.0*np.sum(a)/(np.sum(a)+np.sum(b))
print 1.0*np.sum(a)/(700)
a = [26,  32,  30,  33,  33,  31,  31]
b = [122,   89,   60,   83,   77,   27,   26]
print np.sum(a)
print np.sum(a)+np.sum(b)
print 1.0*np.sum(a)/(np.sum(a)+np.sum(b))
print 1.0*np.sum(a)/(700)

num = np.ones(7)+4
print num


acc = np.array([54,59,57,61,72,45,56])
err = np.array([25,70,9,39,163,1,3])
print np.sum(acc*1.0/(acc+err))/7

test_num = 100
ap = 1.0*np.sum(acc*1.0 / (err + acc)) / 7
ar = 1.0*np.sum(acc*1.0 / (test_num + 2)) / 7

print ap
print ar
